#include<stdio.h>
//函数声明
int sum(int a,int b);
int mins(int a,int b);
int mult(int a,int b);
double divide(int a,int b);

int main()
{
    int num1,num2;
    printf("请输入第一个整数：");
    scanf("%d",&num1);
    printf("请输入第二整数：");
    scanf("%d",&num2);

    //调用函数
    printf("两数相和为：%d\n",sum(num1,num2));
    printf("两数相减为：%d\n",mins(num1,num2));
    printf("两数相乘为：%d\n",mult(num1,num2));
    
    double div = divide(num1,num2);
    if(div != -1)
    {
        printf("俩数之商为：%.2f\n",div);
    }
    else 
    {
        printf("除数不能为0。\n");
    }
    return 0;
}

//函数定义

int sum(int a,int b)
{
    return a + b;
}

int mins(int a,int b)
{
    return a - b;
}

int mult(int a,int b)
{
    return a * b;
}

double divide(int a,int b)
{
    if(b != 0)
    {
        return (double)a / b;
    }
    else 
    {
        return -1;
    }
}